/*
 * @Description: 农业类型管理
 */
import zhreq from "@/api/axios";
export default {
  /**
   * @description: 获取所有数据项列表 *代表必填
   * @param {String/Number} page
   * @param {String/Number} size
   */
  getDataItemByList(params) {
    return zhreq.get(`v3/iot/iotPlatform/queryRtuByCompanyMark?companyMark=${params}`)
  },
  /**
   * @description: 获取所有数据项列表 *代表必填
   * @param {String/Number} page
   * @param {String/Number} size
   */
  getDataTreeList(params) {
    return zhreq.get(`iotApplication/ownership/queryTreeByCompanyMark?companyMark=${sessionStorage.organizationNo}`)
  },

  /**
   * @description: 获取列表 *代表必填
   * @param {Object}  *
   */
  dataItemlist(params) {
    return zhreq.post('v3/iot/device/queryPageByCondition', {
      page: params.page,
      size: params.size,
      entity: params.entity
    });
    // return zhreq.post('v3/iot/device/queryPageByCondition', params)
  },
  /**
   * @description: 批量拥有摄像头
   * @param {Object}  *
   */
  addFarmingTypelist(params) {
    return zhreq.post('v3/iot/device/add', params);
    // return zhreq.post('/base/farmingType/add', params);
  },
  /**
  * @description: 批量拥有摄像头
  * @param {Object}  *
  */
  editFarmingTypelist(params) {
    return zhreq.post('v3/iot/device/edit', params);
    // return zhreq.post('/base/farmingType/add', params);
  },
  /**
   * @description: 批量删除拥有摄像头
   * @param {Object}  *
   */
  delFarmingTypelist(params) {
    return zhreq.get(`v3/iot/device/delByNo?no=${params}`);
  },
  /**
   * @description: 批量删除拥有摄像头
   * @param {Object}  *
   */
  delListFarmingTypelist(params) {
    return zhreq.post(`v3/iot/device/delListByNo`, params);
  },
  /**
   * @description: 通过农场id查询农场所拥有的农业类型
   * @param {Object}  *
   */
  queryCondFarmingTypelist() {
    return zhreq.post('v3/organization/base/farmingType/queryByCondition', {
      // "companyId": localStorage.companyId
      organizationNo: sessionStorage.organizationNo
    });
  }
};
